package com.zmn.oms.zmn.business.interfaces.docking;

import com.zmn.oms.common.exception.OmsBaseException;
import com.zmn.oms.model.dto.order.open.AvailableTimeslotsQuery;
import com.zmn.oms.model.dto.order.proxy.*;
import com.zmn.oms.model.entity.work.OrderWork;
import com.zmn.oms.model.vo.order.open.AvailableTimeslotsVO;
import com.zmn.oms.model.vo.order.open.OrderInfoVO;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 渠道对接接口定义.
 * @author xiewenbing
 * @date 2021/03/24
 */
public interface ChannelDockingBService {

    /**
     * 查询订单
     *
     * @param orderId
     * @param channelId
     * @return
     * @throws OmsBaseException
     */
    OrderInfoVO queryOrder(@NotNull(message = "订单id不能为空") Long orderId, Integer channelId) throws OmsBaseException;

    /**
     * 获取预约时间
     *
     * @param availableTimeslotsQuery
     * @return
     */
    List<AvailableTimeslotsVO> queryAvailableTimeslots(@NotNull(message = "参数不能为空")AvailableTimeslotsQuery availableTimeslotsQuery) throws OmsBaseException;

    /**
     * 取消订单
     *
     * @param cancelOrderDTO
     * @throws OmsBaseException
     */
    void cancelOrder(@NotNull(message = "参数不能为空")CancelOrderDTO cancelOrderDTO) throws OmsBaseException;

    /**
     * 渠道支付
     *
     * @param payOrderDTO
     * @throws Exception
     */
    void payOrder(@NotNull(message = "参数不能为空")PayOrderDTO payOrderDTO) throws Exception;

    /**
     * 创建订单
     * @param createOrderDTO
     * @return
     * @throws OmsBaseException
     */
    OrderWork createOrder(@NotNull(message = "参数不能为空")CreateOrderDTO createOrderDTO) throws OmsBaseException;

    /**
     * 保存订单日志
     *
     * @param orderLogDTO
     * @throws OmsBaseException
     */
    void saveOrderLog(@NotNull(message = "参数不能为空")OrderLogDTO orderLogDTO) throws OmsBaseException;

    /**
     * 保存订单评价
     *
     * @param orderCommentDTO
     * @throws OmsBaseException
     */
    void saveOrderComment(@NotNull(message = "参数不能为空")CommentDTO orderCommentDTO) throws OmsBaseException;

    /**
     * 修改订单信息，包括预约时间，用户地址和电话，渠道订单id，渠道扩展信息，渠道预付状态，可弃单状态等
     *
     * @param updateOrderDTO
     * @throws OmsBaseException
     */
    void updateOrder(@NotNull(message = "参数不能为空")UpdateOrderDTO updateOrderDTO) throws OmsBaseException;

    /**
     * 发起订单自动跟单
     * @param orderAutoTrackDTO
     * @throws OmsBaseException
     */
    void updateOrderAutoTrack(@NotNull(message = "参数不能为空")OrderAutoTrackDTO orderAutoTrackDTO) throws OmsBaseException;

    /**
     * 获得订单的备注信息
     *
     * @param orderId
     * @param workId
     * @param remarkType
     * @return
     */
    String queryOrderRemark(Long orderId, Long workId, Integer remarkType) throws OmsBaseException;
}
